﻿@typeparam TValue
@inherits TextInputBase<TValue>

<div>
@if (!string.IsNullOrEmpty(UseLabel))
{
    <label for=@Id class="block text-sm font-medium text-gray-700">@UseLabel</label>
}
    <div class="mt-1 relative rounded-md shadow-sm">
        <textarea id=@Id name=@Id @bind="CurrentValue" placeHolder=@UsePlaceholder @attributes="IncludeAttributes"
                class=@ClassNames("shadow-sm block w-full sm:text-sm rounded-md", 
                    CssClass(valid:"text-gray-900 focus:ring-indigo-500 focus:border-indigo-500 border-gray-300",
                            invalid:"text-red-900 focus:ring-red-500 focus:border-red-500 border-red-300"))
                />
    @if (HasErrorField)
    {
        <p class="mt-2 text-sm text-red-500" id=@($"{Id}-error")>@ErrorFieldMessage</p>
    }
    else if (!string.IsNullOrEmpty(UseHelp))
    {
        <p id=@($"{Id}-description") class="text-gray-500">@UseHelp</p>
    }
    </div>
</div>
